#ifndef VISIBLEOBJECT_H
#define VISIBLEOBJECT_H

#include "IGameObject.h"
#include <OgreSceneNode.h>
#include <OGRE\OgreEntity.h>
#include "Animator.h"
#include "SettingsManager.h"
#include "btBulletDynamicsCommon.h"
#include "Convert.h"

typedef boost::shared_ptr<Ogre::String> OStringPtr;

struct OgreData
{
	OStringPtr name;
	OStringPtr meshName;
	Ogre::Vector3 pos;
	Ogre::Vector3 scale;
	Ogre::Radian yaw;
	Ogre::Radian pitch;
	Ogre::Radian roll;
	Ogre::Quaternion quat;
	bool visible;
};

typedef boost::shared_ptr<OgreData> OgreDataPtr;

class VisibleObject : public IGameObject
{
public:
	VisibleObject(string actorID);
	VisibleObject(string actorID, string name, btVector3 &pos, btQuaternion &rot, btVector3 &scale, string mesh);
	VisibleObject(boost::shared_ptr<SettingsManager> sm);
	VisibleObject(const OgreDataPtr data);
	VisibleObject(boost::shared_ptr<VisibleObject> ref);
	~VisibleObject(void);
	void setEntityNode(Ogre::SceneNode *node);
	void setAnimator(Animator *anim);
	Ogre::SceneNode *getEntityNode(void) const;
	const OgreDataPtr getOgreInitData(void) const;
	Ogre::Entity* getEntity(void);
	virtual void update(const unsigned long elapsedTime);
	virtual bool dead(void) const;
	virtual void kill(void);
	ObjectType getType(void) const;
	bool hasType(ObjectType type) const;
	void addType(ObjectType type);
	void removeType(ObjectType type);
	void readVisibleObjectFromXML(boost::shared_ptr<SettingsManager> sm);
	Animator* getAnimator(void);
protected:
	Ogre::SceneNode *mpEntityNode;
	Animator *mpAnimator;
	// This variable contains all data is needed for Ogre
	OgreDataPtr mpOgreInitData;
	bool mbDead;
	typeList mTypes;
};

typedef boost::shared_ptr<VisibleObject> VisibleObjectPtr;

#endif